//
//  CYHHotViewController.m
//  Cat
//
//  Created by dllo on 15/11/26.
//  Copyright (c) 2015年 dllo. All rights reserved.
//
//http://api.huapipi.com/show/v2/hot/top/1?deviceId=1826162&uid=1033268


#import "CYHHotViewController.h"

@interface CYHHotViewController ()<UITableViewDelegate, UITableViewDataSource, RollViewDelegate>

@property (nonatomic, strong) UITableView *HotTableView;
@property (nonatomic, strong) NSMutableArray *HotArray;
@property (nonatomic, strong) NSMutableArray *RollArray;

@end

@implementation CYHHotViewController

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.HotArray = [NSMutableArray array];
        self.RollArray = [NSMutableArray array];
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    // 创建View
    [self createView];
    
    // 数据请求
    [self createData];
}

#pragma mark - createData
- (void)createData {
    
}



#pragma mark - createView
- (void)createView {
    
    self.HotTableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UITableViewStylePlain];
    self.HotTableView.delegate = self;
    self.HotTableView.dataSource = self;
    [self.view addSubview:self.HotTableView];
    [self.HotTableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"HotTableView"];
    
    RollView *rollView = [[RollView alloc] initWithFrame:CGRectMake(0, 0, VIEW_WIDTH, VIEW_HEIGHT / 3) imageArr:self.RollArray];
    self.HotTableView.tableHeaderView = rollView;
    rollView.RollDelegate = self;
    
}



#pragma mark - tableViewDelegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HotTableView"];
    
    
    return cell;
}

- (void)pushViewController {
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
